]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
unlockDialog: Do not reset the auth prompt on every tap
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Mon, 25 Aug 2025 23:11:18 +0000 (01:11 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 27 Aug 2025 12:44:06 +0000 (12:44 +0000)
Currently we have a tap event tracker that causes that every time a tap
happens in the lock screen, we reset the auth prompt and this can be
particularly annoying at least in three cases:
 1. Just clicking everywhere in the screen may lead the unlock entry
    content to be cleared
 2. Clicking in the screen while an authentication is in progress,
    cancels it
 3. This may break a multi-factor authentication method, as a single
    click may lead previous steps to be cancelled

So, while resetting the auth prompt is important when we're about to
show it, it's not something we want to do while an authentication has
started.

As per this also do not touch the auth prompt sensitivity unless we're
in an idle phase, or we may end up overriding the auth prompt state,
leading for example to a text entry being editable while we're verifying
the secret

Fixes: 37e55df29865dac13656116efdd7abec8056dea9
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3852>

js/ui/unlockDialog.js

index fae4d0787dc65baa0678a426298e4ffd3763b21e..50c512fb592c08a7a8dcc2a343bcab7079898420 100644 (file)
@@ -16,6 +16,7 @@ import * as MessageTray from './messageTray.js';
 import * as SwipeTracker from './swipeTracker.js';
 import {formatDateWithCFormatString} from '../misc/dateUtils.js';
 import * as AuthPrompt from '../gdm/authPrompt.js';
+import {AuthPromptStatus} from '../gdm/authPrompt.js';
 import {MprisSource} from './mpris.js';
 import {MediaMessage} from './messageList.js';
 
@@ -744,8 +745,15 @@ export const UnlockDialog = GObject.registerClass({
             this._promptBox.add_child(this._authPrompt);
         }
 
-        this._authPrompt.reset();
-        this._authPrompt.updateSensitivity(true);
+        const {verificationStatus} = this._authPrompt;
+        switch (verificationStatus) {
+        case AuthPromptStatus.NOT_VERIFYING:
+        case AuthPromptStatus.VERIFICATION_CANCELLED:
+        case AuthPromptStatus.VERIFICATION_FAILED:
+            this._authPrompt.reset();
+            this._authPrompt.updateSensitivity(
+                verificationStatus === AuthPromptStatus.NOT_VERIFYING);
+        }
     }
 
     _maybeDestroyAuthPrompt() {